package com.zhangshuo.common.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * 校验字段是否在此范围
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(In.List.class)
@Documented
@Constraint(validatedBy = {})
public @interface In {
	String message() default "{javax.validation.constrains.In.message}";
	Class<?>[] groups() default {};
	Class<? extends Payload>[] payload() default {};
	String[] value() default {};

	@Target({ElementType.FIELD})
	@Retention(RetentionPolicy.RUNTIME)
	@Documented
	@interface List{
		In[] value();
	}

}
